<template>
	<i class="icon-container iconfont" :class="fontClass"></i>
</template>

<script>
// class映射，传正常名字，映射为图标的class
const classMap = {
	error: 'icon-cuowu',
	arrowUp: 'icon-xiangshang',
	arrowDown: 'icon-xiangxia',
	warn: 'icon-jinggao',
	weixin: 'icon-logo-wechat',
	chat: 'icon-liuyan',
	info: 'icon-xinxi',
	empty: 'icon-kongneirong',
	success: 'icon-zhengque',
	close: 'icon-guanbi',
	code: 'icon-code',
	qq: 'icon-QQ-circle-fill',
	home: 'icon-zhuye',
	email: 'icon-email',
	github: 'icon-github',
	about: 'icon-set_about_hov',
	blog: 'icon-blog',
}
export default {
	name: 'Icon',
	props: {
		type: {
			type: String,
			required: true,
		},
	},
	computed: {
		// 图标类样式
		fontClass() {
			return classMap[this.type]
		},
	},
}
</script>

<style lang="less" scoped>
@import '~@/assets/icon/iconfont.css';
.a {
	font-size: 14px;
}
</style>
